package com.spsoft.dmzeinvoice.exception;


import com.spsoft.core.model.Result;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;


/**
 * 全局异常处理
 */
@Slf4j
@RestControllerAdvice
public class DmzGlobalExceptionHandler {

    /**
     * 处理自定义异常
     */
    @ExceptionHandler(value = DmzLogException.class)
    public Result baseException(DmzLogException e) {
        return Result.ERROR(e.getCode(), e.getMsg());
    }

}
